<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
   <button onclick="location.reload()">刷新</button>
   <hr>
   <button onclick="location.replace('http://163.com')">replace</button>
   <button onclick="location.assign('http://126.com')">assign</button>
   <button onclick="location.href='http://www.taobao.com'">href</button>
	

</body>

    <script>
        console.log('URL:'+location.href);
        console.log('协议:'+location.protocol);
        console.log('域名:'+location.hostname);
        console.log('主机名+端口:'+location.host);
        console.log('路径:'+location.pathname);
        console.log('参数:'+location.search);
        console.log('锚点:'+location.hasg);

        // location.href = 'http://www.baidu.com';
        // location.search = '?age=18';
        // location.hash = '#100';
    </script>
</html>